function PlayerModel(){}
PlayerModel.prototype = new Entity();


PlayerModel.prototype.posX;
PlayerModel.prototype.posY;


PlayerModel.prototype.init = function()
{
  this.posX = 0;
  this.posY = 0;

  RTE.RenderManager.addEntity("Sprite", "PlayerModel");
  RTE.RenderManager.PlayerModel.loadImage("images/sprites/player01.png");
  RTE.RenderManager.PlayerModel.context = RTE.RenderManager.Viewport.context;
}


PlayerModel.prototype.update = function()
{
  if (RTE.InputManager.KeyboardInput.pressedKey["shift"] == true) {
    var m = 2;
  } else {
    var m = 1;
  }

  if (RTE.InputManager.KeyboardInput.pressedKey["up"] == true) {
    this.posY += 3 * m;
  }
  if (RTE.InputManager.KeyboardInput.pressedKey["down"] == true) {
    this.posY -= 3 * m;
  }
  if (RTE.InputManager.KeyboardInput.pressedKey["left"] == true) {
    this.posX -= 3 * m;
  }
  if (RTE.InputManager.KeyboardInput.pressedKey["right"] == true) {
    this.posX += 3 * m;
  }
  
  RTE.RenderManager.PlayerModel.posX = this.posX;
  RTE.RenderManager.PlayerModel.posY = this.posY;
}